import React, { useId } from "react";

const App = () => {
  const username = useId();
  const password = useId();

  return (
    <>
      <h2>useId</h2>
      <label htmlFor={username}>姓名：</label>
      <input type="text" placeholder="请输入姓名" id={username} />

      <label htmlFor={password}>密码：</label>
      <input type="password" placeholder="请输入密码" id={password} />
    </>
  );
};

export default App;
